<article class="cl pd-20">
    <form action="" method="post" class="form form-horizontal" id="form-save">
        <input type="hidden" id="groupid" name="groupid" value="{$data.groupid}">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>用户组名称：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="{$data.groupname}" placeholder="" id="groupname"
                    name="groupname" datatype="*4-16" nullmsg="用户组名称">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">级别值：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="number" class="input-text" value="{$data.level}" placeholder="级别" id="level" name="level" max="99" min="-9">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">备注：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" value="{$data.remark}" placeholder="备注" id="remark" name="remark">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">权限设置：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <div class="row">
                    <label class="form-label col-xs-4 col-sm-3">
                        最大收藏夹数
                    </label>
                    <div class="formControls col-xs-6 col-sm-6">
                        <input type="text" class="input-text" value="{$data.favanum}" placeholder="收藏夹数" id="favanum"
                            name="favanum">
                    </div>
                </div>
                <div class="row">
                    <label class="form-label col-xs-4 col-sm-3">
                        每天最大投稿数
                    </label>
                    <div class="formControls col-xs-6 col-sm-6">
                        <input type="text" class="input-text " value="{$data.dayaddinfo}" placeholder="每天最大投稿数"
                            id="dayaddinfo" name="dayaddinfo">
                    </div>
                </div>
                <div class="row">
                    <label class="form-label col-xs-4 col-sm-3">
                        投稿信息审核
                    </label>
                    <div class="formControls col-xs-6 col-sm-6">
                        <div class="radio-box">
                            <input type="radio" name="infochecked" id="status-2" value="0" {$data.infochecked==null &&
                                $data.infochecked==0 ? 'checked' : "" }>
                            <label for="status-2">需审核</label>
                        </div>
                        <div class="radio-box">
                            <input type="radio" name="infochecked" id="status-1" value="1" {$data.infochecked!=null &&
                                $data.infochecked==1 ? 'checked' : "" }>
                            <label for="typeId-1">无需审核</label>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <label class="form-label col-xs-4 col-sm-3">
                        会员组前台可注册
                    </label>
                    <div class="formControls col-xs-6 col-sm-6">
                        <div class="radio-box">
                            <input type="radio" name="canreg" id="status-2" value="0" {$data.canreg==null &&
                                $data.canreg==0 ? 'checked' : "" }>
                            <label for="status-2">不可</label>
                        </div>
                        <div class="radio-box">
                            <input type="radio" name="canreg" id="status-1" value="1" {$data.canreg!=null &&
                                $data.canreg==1 ? 'checked' : "" }>
                            <label for="typeId-1">可</label>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="button" class="btn btn-success radius" id="form-save-button"><i class="icon-ok"></i>
                    确定</button>
                <button type="button" class="btn btn-default radius" onClick="layer_close();"><i
                        class="Hui-iconfont">&#xe66b;</i>取消</button>
            </div>
        </div>
    </form>
</article>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
    $(function () {
        $("#form-save-button").click(function () {
            var data = $("#form-save").serializeArray();
            $.ajax({
                type: 'POST',
                url: '{:url("save")}',
                data: data,
                dataType: 'json',
                success: function (res) {
                    // console.log(res);
                    if (res.code == 0) {
                        layer.msg(res.msg, {
                            icon: 1,
                            time: 1000
                        }, function () {
                            parent.location.reload(); // 父页面刷新
                            var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                            parent.layer.close(index);
                        });
                    } else {
                        layer.msg(res.msg, {
                            icon: 5,
                            time: 1000
                        });
                        return false;
                    }
                }
            })
        });
    })
</script>
<!--请在上方写此页面业务相关的脚本-->